import Vue from 'vue';
import App from './App.vue' ;//顶层组件
import VueRouter from 'vue-router';

// import loading from './components/loading'; //引入全局自定义组件
//使用|安装路由
Vue.use(VueRouter);
// Vue.use(loading);//调用loading插件|组件内部的install方法，并传递Vue类过去



//配置路由
// import {routes} from './router.config';  A1
// import routes from './router.config'; //A2
import routes from './router.config'; //A3

//创建路由对象
// let router=new VueRouter({
//   // routes:routes  //routes A1
//   routes:routes.a  //routes A2
// });
let router= new VueRouter(routes);

import {Swipe,SwipeItem} from 'vue-swipe';
Vue.component("swipe",Swipe)
Vue.component("swipe-item",SwipeItem)
import '../node_modules/vue-swipe/dist/vue-swipe.css';

//引入axios中间件交互插件
import axios from 'axios';
axios.defaults.withCredentials=true;
Vue.prototype.$http = axios;






//根实例
new Vue({
  el: '#app',
  render: h => h(App),//选项  渲染函数
  router, ////注册到根实例
  components: {
    "swipe":'Swipe',
    "swipe-item":'SwipeItem'
  },
});